package ru.spb.osll.myfit.util;

import static org.junit.Assert.assertEquals;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.LinkedList;

import org.junit.Test;

public class IOUtilsTest {
	@Test
	public void testReadLines() throws IOException {
		String line1 = "testLine1";
		String line2 = "testLine2";
		String input = new String(line1 + "\n" + line2);
		LinkedList<String> lines = new LinkedList<String>();
		lines.add(line1);
		lines.add(line2);
		InputStream stream = new ByteArrayInputStream(input.getBytes());
		BufferedReader reader = new BufferedReader(new InputStreamReader(stream));	
		assertEquals(lines, IOUtils.readLines(reader));
		
	}

}
